<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="ajax.js"></script>
    <script>
        window.onload=function(){
            document.onclick=function(){
                ajax('json.txt',function(data){
                    console.log(data);
                },function(){

                })
            }
        }
    </script>
</head>
<body>

</body>
</html>